import Footer from '@/components/footer/footer.vue'
export default {
    components: {
        Footer
    },
    data() {
        return {
            isFixed: false,
            tabs: {
                live: '居家生活',
                part: '运动旅行',
                clothing: '服饰鞋包',
                appliance: '数码家电',
                wash: '个护清洁',
                diet: '美食酒水'
            }
        }
    },
    mounted() {
        window.addEventListener('scroll', this.handleScroll)
    },
    destroyed() {
        window.removeEventListener('scroll', this.handleScroll)
    },
    methods: {
        handleScroll() {
            let scrollTop =
                window.pageYOffset ||
                document.documentElement.scrollTop ||
                document.body.scrollTop
            const offsetTop = document.querySelector('#head').offsetTop
            if (scrollTop >= offsetTop) {
                this.isFixed = true
            } else {
                this.isFixed = false
            }
        }
    }
}